<template>
	<view class="centers">
		<view class="ikz-top-bg">
			<image class="ikz-top-bg-img" :src="service_img"></image>
		</view>
		<view class="title_txt">
			<view class="left_box">
				今日 2024年05月26日
			</view>
		</view>
		<view class="marer-box">
			<image src="/static/supermarket/index/mar_img.png" style="width: 148rpx;height: 148rpx;" mode=""></image>
			<view class="r-box">
				<view class="ll-felt">
					<view class="mar-mendian">
						门店名称
					</view>
					<view class="time-txt">
						营业时间:09:00-19:00
					</view>
				</view>

				<view class="rr-box" @click="set">
					营业中
				</view>

			</view>
		</view>

		<view class="jilubox">
			<!-- 访客 -->
			<view class="itembox">
				<view class="fktxt">
					访客
				</view>
				<view class="numtxt">
					4552
				</view>
				<view class="zrtxt">
					昨日 233
				</view>
			</view>
			<!-- 订单数 -->
			<view class="itembox">
				<view class="fktxt">
					订单数
				</view>
				<view class="numtxt">
					4552
				</view>
				<view class="zrtxt">
					昨日 23
				</view>
			</view>
			<!-- 营业额 -->
			<view class="itembox">
				<view class="fktxt">
					营业额
				</view>
				<view class="numtxt">
					4552
				</view>
				<view class="zrtxt">
					昨日 473.83
				</view>
			</view>
		</view>

		<!-- 营业工具 -->
		<view class="yybox">
			<view class="yy-txt">
				营业工具
			</view>
			<view class="cenbpx">
				<view class="itembox" v-for="(i,k) in tablist" :key="k" @click="tourl(i,k)">
					<image :src="i.Image" style="width: 92rpx;height: 92rpx;margin-left: 6rpx;" mode=""></image>
					<view class="txt">
						{{i.text}}
					</view>
				</view>
			</view>
		</view>

		<ikz-tabbar :show-data="tabbar_Data"></ikz-tabbar>
		<uni-popup ref="popup" type="bottom" border-radius="10px 10px 0 0">
			<view class="popbox">
				<view class="pp_top">
					<view class="ll-txt" @click="canceltxt">
						取消
					</view>
					<view class="cen-txt">
						配送设置
					</view>
					<view class="enter-txt" @click="entertxt">
						确定
					</view>
				</view>

				<view class="center-box">
					<view class="tab-item" v-for="(item,index) in poplist" :key="index" @click="pophah(item,index)">
						<view :class="['tab-item', { selected: selectedIndices2 == index ? 'selected':''}]">
							{{ item.cate_name }}
						</view>
					</view>
				</view>
			</view>
		</uni-popup>

		<uni-popup ref="popupyy" type="bottom" border-radius="10px 10px 0 0">
			<view class="popbox">
				<view class="pp_top">
					<view class="ll-txt" @click="yycanceltxt">
						取消
					</view>
					<view class="cen-txt">
						配送设置
					</view>
					<view class="enter-txt" @click="yyentertxt"> 
						确定
					</view>
				</view>

				<view class="center-box">
					<view class="tab-item" v-for="(item,index) in yylist" :key="index" @click="yyhah(item,index)">
						<view :class="['tab-item', { selected: selectedIndices1 == index ? 'selected':''}]">
							{{ item.cate_name }}
						</view>
					</view>
				</view>
			</view>
		</uni-popup>
	</view>
</template>

<script>
	import ikzTabbar from '@/pages/Component/Public/tab-bar/tab-bar.vue';
	export default {
		components: {
			ikzTabbar
		},
		data( ) {
			return {
				tabbar_Data: {
					type: 1,
					list: [ {
							title: "订单",
							url: "/pages/Component/supermarket/Program/index/index",
							iconPath: "/static/supermarket/tabbar/index_task.png",
							selectedIconPath: "/static/supermarket/tabbar/index.png",
							status: 1,
						},
						{
							title: "商铺",
							url: "/pages/Component/supermarket/Program/merchant/merchant",
							iconPath: "/static/supermarket/tabbar/marer_task.png",
							selectedIconPath: "/static/supermarket/tabbar/marer.png",
							status: 1,
						},
						{
							title: "我的",
							url: "/pages/Component/supermarket/Program/user/index",
							iconPath: "/static/supermarket/tabbar/user_task.png",
							selectedIconPath: "/static/supermarket/tabbar/user.png",
							status: 1,
						},
					],
				},
				service_img: '/static/supermarket/index/mar_bg.png',
				tablist: [ {
						Image: '/static/supermarket/index/mar_yx.png',
						text: '营业信息',
						url: '/pages/Component/supermarket/Program/merchant/takinginfo/takinginfo'
					},
					{
						Image: '/static/supermarket/index/mar_sp.png',
						text: '商品管理',
						url: '/pages/Component/supermarket/Program/merchant/commodity/commodity'
					},
					{
						Image: '/static/supermarket/index/mar_gk.png',
						text: '顾客评价',
						url: '/pages/Component/supermarket/Program/merchant/gupingpage/gupingpage'
					},
					{
						Image: '/static/supermarket/index/mar_yxia.png',
						text: '营销管理',
						url: '/pages/Component/supermarket/Program/merchant/yingxiangpage/yingxiangpage'
					},
					{
						Image: '/static/supermarket/index/mar_ps.png',
						text: '配送设置',
						url: ''
					},
					{
						Image: '/static/supermarket/index/mar_yxtj.png',
						text: '营业统计',
						url: '/pages/Component/supermarket/Program/merchant/yingyetongjipage/yingyetongjipage'
					},
				],
				poplist: [ {
					cate_name: '跑腿配送'
				}, {
					cate_name: '商家自配'
				} ],
				selectedIndices2: 0,
				yylist: [ {
					cate_name: '营业中'
				},{
					cate_name: '打烊中'
				},{
					cate_name: '休息中'
				} ],
				selectedIndices1: 0,
				
			};
		},
		methods: {
			set(){
				this.$refs.popupyy.open( 'bottom' )
			},
			tourl( item, index ) {
				if ( index == 4 ) {
					this.$refs.popup.open( 'bottom' )
				} else {
					uni.navigateTo( {
						url: item.url
					} )
				}

			},
			pophah( item, index ) {
				console.log( index, '每一项1' );
				this.selectedIndices2 = index
				this.$refs.popup.close( )
			},
			yyhah(item,index){
				this.selectedIndices1 = index
				this.$refs.popupyy.close( )
			},
			entertxt( ) {
				this.$refs.popup.close( )
			},
			canceltxt( ) {
				this.$refs.popup.close( )
			},
			
			yyentertxt( ) { 
				this.$refs.popupyy.close( )
			},
			yycanceltxt( ) {
				this.$refs.popupyy.close( )
			},
		},
	}
</script>

<style lang="scss" scoped>
	.popbox {
		width: 750rpx;
		height: 520rpx;
		background: #FFFFFF;
		border-radius: 40rpx 40rpx 0rpx 0rpx;
		padding: 28rpx 30rpx;
		box-sizing: border-box;

		.pp_top {
			width: 100%;
			height: 44rpx;
			display: flex;
			align-items: center;
			justify-content: space-between;

			.ll-txt {
				width: 70rpx;
				height: 44rpx;
				font-weight: 400;
				font-size: 30rpx;
				color: #666666;
				text-align: left;
			}

			.cen-txt {
				width: 120rpx;
				height: 44rpx;
				font-weight: 400;
				font-size: 30rpx;
				color: #000000;
				text-align: center;
			}

			.enter-txt {
				width: 60rpx;
				height: 44rpx;
				font-weight: 400;
				font-size: 30rpx;
				color: #247EFF;
				text-align: center;
			}
		}

		.center-box {
			width: 100%;
			height: 200rpx;
			margin-top: 48rpx;

			.tab-item {
				width: 100%;
				height: 100rpx;
				line-height: 100rpx;
				text-align: center;
				font-weight: 400;
				font-size: 30rpx;
				color: #666666;

				.selected {
					/* 选中时的样式，比如背景色为红色 */
					color: #000000;
					border-radius: 16rpx 16rpx 16rpx 16rpx;
				}
			}
		}
	}


	.ikz-top-bg {
		position: fixed;
		top: 0px;
		left: 0px;
		z-index: -1;

		.ikz-top-bg-img {
			width: 750rpx;
			height: 500rpx;
		}
	}

	.title_txt {
		width: 522rpx;
		height: 62rpx;
		margin-top: 100rpx;
		margin-left: 34rpx;
		z-index: 2;
		display: flex;
		align-items: center;
		justify-content: space-between;

		.left_box {
			width: 522rpx;
			height: 62rpx;
			display: flex;
			align-items: center;
			justify-content: space-between;
			padding: 4rpx;
			box-sizing: border-box;
			font-weight: 500;
			font-size: 30rpx;
			color: #247EFF;
			text-align: left;

		}

	}

	.marer-box {
		width: 100%;
		height: 192rpx;
		padding: 22rpx 30rpx 28rpx 30rpx;
		box-sizing: border-box;
		display: flex;
		align-items: center;

		.r-box {
			width: 522rpx;
			height: 192rpx;
			margin-left: 20rpx;
			display: flex;
			align-items: center;
			justify-content: space-between;

			.ll-felt {
				width: 260rpx;
				height: 148rpx;
				padding: 24rpx 0;
				box-sizing: border-box;

				.mar-mendian {
					width: 100%;
					height: 44rpx;
					font-weight: 500;
					font-size: 30rpx;
					color: #000000;
					text-align: left;
					margin-bottom: 14rpx;
				}

				.time-txt {
					width: 250rpx;
					height: 38rpx;
					font-weight: 400;
					font-size: 26rpx;
					color: #000000;
					text-align: left;
				}
			}

			.rr-box {
				width: 118rpx;
				height: 50rpx;
				background: #247EFF;
				border-radius: 40rpx 40rpx 40rpx 0rpx;
				font-weight: 400;
				font-size: 26rpx;
				color: #FFFFFF;
				text-align: center;
				line-height: 50rpx;
			}
		}
	}

	.jilubox {
		width: 690rpx;
		height: 206rpx;
		background: #FFFFFF;
		border-radius: 24rpx 24rpx 24rpx 24rpx;
		margin: 0 auto;
		display: flex;
		justify-content: space-between;

		.itembox {
			width: 208rpx;
			height: 206rpx;
			display: flex;
			flex-direction: column;
			align-items: center;
			justify-content: space-between;
			padding: 28rpx 0 32rpx 0;
			box-sizing: border-box;

			.fktxt {
				width: 100%;
				height: 38rpx;
				font-weight: 400;
				font-size: 26rpx;
				color: #666666;
				text-align: center;
			}

			.numtxt {
				width: 100%;
				height: 44rpx;
				font-weight: bold;
				font-size: 30rpx;
				color: #000000;
				text-align: center;
			}

			.zrtxt {
				width: 100%;
				height: 34rpx;
				font-weight: 400;
				font-size: 22rpx;
				color: #666666;
				text-align: center;
			}
		}
	}

	.yybox {
		width: 100%;
		height: 638rpx;
		margin-top: 24rpx;
		padding: 24rpx 30rpx;
		box-sizing: border-box;

		.yy-txt {
			width: 100%;
			height: 44rpx;
			font-weight: 500;
			font-size: 30rpx;
			color: #000000;
			text-align: left;
		}

		.cenbpx {
			width: 100%;
			height: 316rpx;
			margin-top: 30rpx;
			display: flex;
			flex-wrap: wrap;
			align-content: space-around;
			padding: 0 0 0 24rpx;
			box-sizing: border-box;

			.itembox {
				width: 104rpx;
				height: 138rpx;
				margin-right: 80rpx;

				&:nth-child(4) {
					margin-right: 0;
				}

				.txt {
					width: 104rpx;
					height: 38rpx;
					font-weight: 400;
					font-size: 26rpx;
					color: #000000;
					text-align: center;
				}
			}
		}
	}
</style>